//
//  SegProgressView.m
//  UEAssistant
//
//  Created by mac on 2017/2/13.
//  Copyright © 2017年 youyixinxi. All rights reserved.
//

#import "SegProgressView.h"

#define footColor       RGB(5, 160, 194, 1)
#define midColor        RGB(20, 140, 162, 1)
#define topColor        RGB(12, 104, 120, 1)

@interface SegProgressView ()

{

    CGFloat         _width_one;
    CGFloat         _width_two;
    CGFloat         _width_thr;

}

@end

@implementation SegProgressView

- (id)initWithFrame:(CGRect)frame andWidthone:(CGFloat)widthone andWidthtwo:(CGFloat)widthtwo andWidththr:(CGFloat)widththr{

    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        _width_one = widthone;
        _width_two = widthtwo;
        _width_thr = widththr;
        [self initlizeUserface];
    }
    return self;
}

+ (id)initWithFrame:(CGRect)frame andWidthone:(CGFloat)widthone andWidthtwo:(CGFloat)widthtwo andWidththr:(CGFloat)widththr{
    
    SegProgressView *progressView = [[SegProgressView alloc]initWithFrame:frame andWidthone:widthone andWidthtwo:widthtwo andWidththr:widththr];
    return progressView;
}




//- (id)initWithFrame:(CGRect)frame {
//    self = [super initWithFrame:frame];
//    
//    if (self) {
//        self.backgroundColor = [UIColor clearColor];
//        [self initlizeUserface];
//    }
//    return self;
//}

- (void)initlizeUserface{

    UIView *baseView = [[UIView alloc]initWithFrame:CGRectMake(0, 20, 250*Radio, 8)];
    baseView.backgroundColor = RGB(9, 185, 242, 1);
    baseView.layer.cornerRadius = 4;
    baseView.layer.masksToBounds = YES;
    [self addSubview:baseView];

    
    _viewone = [[UIView alloc]initWithFrame:CGRectMake(0, 20, _width_one*Radio, 8)];
    _viewone.backgroundColor = footColor;
    _viewone.layer.cornerRadius = 4;
    _viewone.layer.masksToBounds = YES;
    [self addSubview:_viewone];
    
    _viewtwo = [[UIView alloc]initWithFrame:CGRectMake(0, 20, _width_two*Radio, 8)];
    _viewtwo.backgroundColor = midColor;
    _viewtwo.layer.cornerRadius = 4;
    _viewtwo.layer.masksToBounds = YES;
    [self addSubview:_viewtwo];
    
    _viewthr = [[UIView alloc]initWithFrame:CGRectMake(0, 20, _width_thr*Radio, 8)];
    _viewthr.backgroundColor = topColor;
    _viewthr.layer.cornerRadius = 4;
    _viewthr.layer.masksToBounds = YES;
    [self addSubview:_viewthr];

    _imageone = [[UIImageView alloc]initWithFrame:CGRectMake(_viewthr.frame.size.width-30, -2, 55, 22)];
    _imageone.image = [UIImage imageNamed:@"屏幕快照 downnnnn"];
    [self addSubview:_imageone];
    
    _imagetwo = [[UIImageView alloc]initWithFrame:CGRectMake(_viewtwo.frame.size.width-30, 28, 55, 22)];
    _imagetwo.image = [UIImage imageNamed:@"屏幕快照 uuuppp"];
    [self addSubview:_imagetwo];

    _imagethr = [[UIImageView alloc]initWithFrame:CGRectMake(_viewone.frame.size.width-30, -2, 55, 22)];
    _imagethr.image = [UIImage imageNamed:@"屏幕快照 downnnnn"];
    [self addSubview:_imagethr];

    _textLabelone = [[UILabel alloc]initWithFrame:CGRectMake(4, -1, 55, 22)];
    _textLabelone.backgroundColor = [UIColor clearColor];
    _textLabelone.font = [UIFont systemFontOfSize:11];
    _textLabelone.textColor = [UIColor darkGrayColor];
    _textLabelone.text = @"校对:20%";
    [_imageone addSubview:_textLabelone];
    
    _textLabeltwo = [[UILabel alloc]initWithFrame:CGRectMake(4, 1, 55, 22)];
    _textLabeltwo.backgroundColor = [UIColor clearColor];
    _textLabeltwo.font = [UIFont systemFontOfSize:11];
    _textLabeltwo.textColor = [UIColor darkGrayColor];
    _textLabeltwo.text = @"编辑:50%";
    [_imagetwo addSubview:_textLabeltwo];

    _textLabelthr = [[UILabel alloc]initWithFrame:CGRectMake(4, -1, 55, 22)];
    _textLabelthr.backgroundColor = [UIColor clearColor];
    _textLabelthr.font = [UIFont systemFontOfSize:11];
    _textLabelthr.textColor = [UIColor darkGrayColor];
    _textLabelthr.text = @"翻译:80%";
    [_imagethr addSubview:_textLabelthr];

}


@end
